/*
 *
 * author: fernado
 * create date: 2011-5-7
 */

package app;

import iceworld.fernado.entity.Table;
import iceworld.fernado.file.WriteFile;
import iceworld.fernado.file.impl.LoadResource;

import java.util.Map;

public class Application {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		LoadResource lr = new LoadResource();
		lr.readResources();

		Map<String, Table> tables = lr.getTables();
		WriteFile.getInstance().deleteExistFiles();
		for (Map.Entry<String, Table> me: tables.entrySet()) {
			String tableName = me.getKey();
			Table table = me.getValue();
			WriteFile.getInstance().generateCSharpFile(tableName, table.getFields());
		}
	}

}
